package com.systop.mapper;

import com.systop.pojo.Goods_type;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author zhangnan
 * @Data 2020/8/003 下午 4:30
 * @Descriiption
 **/
@Mapper
public interface GoodsTypeMapper {
    //分页查询

    //查所有商品分类
    @Select("select *from goods_type")
    List<Goods_type> selectGoodsTypeAll();
    //添加商品分类
    @Insert("insert into goods_type(goods_type_name,goods_type_photo) values(#{goods_type_name},#{goods_type_photo})")
    Integer insertGoodsType(Goods_type goods_type);
    //修改之前查询(根据id查询)
    @Select("select *from goods_type where goods_type_id=#{goods_type_id}")
    Goods_type selectGoodsTypeByid(Integer goods_type_id);
    //修改商品分类
    @Update("update goods_type set goods_type_name=#{goods_type_name},goods_type_photo=#{goods_type_photo} where goods_type_id=#{goods_type_id}")
    Integer updateGoodsType(Goods_type goods_type);
    //删除商品分类(根据id删除)
    @Delete("delete from goods_type where goods_type_id=#{goods_type_id}")
    Integer deleteBannerByid(Integer goods_type_id);
    //批量删除
}
